package meconsea.life.admin.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import meconsea.life.sys.entity.AbsEntity;

@SuppressWarnings("serial")
@Entity
@Table(name="SYS_ADMIN_USER")
@NamedQueries({
	@NamedQuery(name=AdminUser.FIND_LOGINNAME,query=" SELECT O from AdminUser O where O.loginName=:loginname ")
})
public class AdminUser extends AbsEntity {
	public static final String FIND_LOGINNAME = "au_find_loginname";
	@Column(name="loginname",length=64)
	private String loginName;
	
	@Column(name="password",length=128)
	private String password;
	
	@Column(name="realname",length=64)
	private String realName;
	
	@Column(length=128)
	private String contel;
	
	@Column(length=256)
	private String conaddress;
	
	@Column(length=18)
	private String psnCard;
	
	@Column(length=2048)
	private String popedomJSON;
	
	@Column(length=64)
	private String email;
	
	@Column(length=64)
	private String msn;
	
	@Column(length=64)
	private String qq;
	

	@OneToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
	@JoinTable(name="sys_user_pv_map",
			joinColumns=@JoinColumn(name="userId"),
			inverseJoinColumns=@JoinColumn(name="pvId"))
	private AdminPV adminPv;
	
	
	@Column(name="status")
	private int status;
	
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	
	public AdminPV getAdminPv() {
		return adminPv;
	}

	public void setAdminPv(AdminPV adminPv) {
		this.adminPv = adminPv;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getContel() {
		return contel;
	}

	public void setContel(String contel) {
		this.contel = contel;
	}

	public String getConaddress() {
		return conaddress;
	}

	public void setConaddress(String conaddress) {
		this.conaddress = conaddress;
	}

	public String getPsnCard() {
		return psnCard;
	}

	public void setPsnCard(String psnCard) {
		this.psnCard = psnCard;
	}

	public String getPopedomJSON() {
		return popedomJSON;
	}

	public void setPopedomJSON(String popedomJSON) {
		this.popedomJSON = popedomJSON;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMsn() {
		return msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}
}
